package cn.itsource.pethome.product.domain;


import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 服务实体类
 */
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class Product {
    //主键id
    private Long id;
    //服务名称
    private String name;
    //图片
    private String resources;
    //销售价
    private BigDecimal saleprice;
    //下架时间
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date offsaletime = new Date();
    //上架时间
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date onsaletime;
    //上架状态 0下架 1上架
    private Long state = 0L;
    //成本价
    private String costprice;
    //创建时间
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date createtime=new Date();
    //销量
    private Long salecount = 0L;
    //服务详情
    private ProductDetail productDetail;

    @Override
    public String toString() {
        return "Product{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", resources='" + resources + '\'' +
                ", saleprice=" + saleprice +
                ", offsaletime=" + offsaletime +
                ", onsaletime=" + onsaletime +
                ", state=" + state +
                ", costprice='" + costprice + '\'' +
                ", createtime=" + createtime +
                ", salecount=" + salecount +
                '}';
    }
}
